Datos del comprador
Ejemplos de Integración
Para crear tickets con la información de la persona que compró el ticket en la venta primaria, debes utilizar el siguiente endpoint:
- cURL
- Python
- Java
- PHP
A continuación les brindamos un ejemplo de cómo notificar a menta de la emisión de un ticket con la información del comprador en venta primaria, con datos ficticios, utilizando cURL.
curl -X POST 'https://api.mentatickets.com/v1/tickets'
-H 'Authorization: YOUR_API_KEY'
-H 'Content-Type: application/json'
--data-raw '[
{
"ticketOptionId": "0001",
"showId": "4726",
"externalReferenceEventId": "the-lion-king-broadway",
"buyer": "buyer@emaildomain.com",
"ticketId": "111",
"ticketAccess": {
"type": "OTHER",
"locator": "D02KWWKS029F"
},
"primarySaleBuyerData": {
"firstName": "Juan",
"lastName": "Pérez",
"identificationType": "DNI",
"identificationNumber": "12345678",
"phoneNumber": "+5491123456789"
}
}
]'
A continuación les brindamos un ejemplo de cómo notificar a menta de la emisión de un ticket con la información del comprador en venta primaria, con datos ficticios, utilizando python.
import requests
import json
url = "https://api.mentatickets.com/v1/tickets"
headers = {
"Authorization": "YOUR_API_KEY",
"Content-Type": "application/json",
}
ticketOptionId = "0001"
showId = "4726"
externalReferenceEventId = "the-lion-king-broadway"
buyer = "buyer@emaildomain.com"
ticketId = "111"
ticketAccessType = "OTHER"
locator = "D02KWWKS029F"
firstName = "Juan"
lastName = "Pérez"
identificationType = "DNI"
identificationNumber = "12345678"
phoneNumber = "+5491123456789"
data = [
{
"ticketOptionId": ticketOptionId,
"showId": showId,
"externalReferenceEventId": externalReferenceEventId,
"buyer": buyer,
"ticketId": ticketId,
"ticketAccess": {
"type": ticketAccessType,
"locator": locator,
},
"primarySaleBuyerData": {
"firstName": firstName,
"lastName": lastName,
"identificationType": identificationType,
"identificationNumber": identificationNumber,
"phoneNumber": phoneNumber,
}
}
]
response = requests.post(url, headers=headers, data=json.dumps(data))
A continuación les brindamos un ejemplo de cómo notificar a menta de la emisión de un ticket con la información del comprador en venta primaria, con datos ficticios, utilizando JAVA.
import okhttp3.*;
import java.io.IOException;
OkHttpClient client = new OkHttpClient();
MediaType JSON = MediaType.get("application/json; charset=utf-8");
String ticketOptionId = "0001";
String showId = "4726";
String externalReferenceEventId = "the-lion-king-broadway";
String buyer = "buyer@emaildomain.com";
String ticketId = "111";
String ticketAccessType = "OTHER";
String locator = "D02KWWKS029F"
String firstName = "Juan"
String lastName = "Pérez"
String identificationType = "DNI"
String identificationNumber = "12345678"
String phoneNumber = "+5491123456789"
String json = String.format("""
[
{
"ticketOptionId": "%s",
"showId": "%s",
"externalReferenceEventId": "%s",
"buyer": "%s",
"ticketId": "%s",
"ticketAccess": {
"type": "%s",
"locator": "%s",
},
"primarySaleBuyerData": {
"firstName": "%s",
"lastName": "%s",
"identificationType": "%s",
"identificationNumber": "%s",
"phoneNumber": "%s",
}
}
]
""", ticketOptionId, showId, externalReferenceEventId, buyer, ticketId, ticketAccessType, locator, status, firstName, lastName, identificationType, identificationNumber, phoneNumber);
RequestBody body = RequestBody.create(JSON, json);
Request request = new Request.Builder()
.url("https://api.mentatickets.com/v1/tickets")
.post(body)
.addHeader("Authorization", "YOUR_API_KEY")
.addHeader("Content-Type", "application/json")
.build();
try (Response response = client.newCall(request).execute()) {
System.out.println(response.body().string());
} catch (IOException e) {
e.printStackTrace();
}
A continuación les brindamos un ejemplo de cómo notificar a menta de la emisión de un ticket con la información del comprador en venta primaria, con datos ficticios, utilizando PHP.
<?php
$url = "https://api.mentatickets.com/v1/tickets";
$headers = array(
"Authorization: YOUR_API_KEY",
"Content-Type: application/json",
);
$data = array(
array(
"ticketOptionId" => "0001",
"showId" => "4726",
"externalReferenceEventId" => "the-lion-king-broadway",
"buyer" => "buyer@emaildomain.com",
"ticketId" => "111",
"ticketAccess" => array(
"type" => "OTHER",
"locator" => "D02KWWKS029F",
),
"primarySaleBuyerData" => array(
"firstName" => "Juan",
"lastName" => "Pérez",
"identificationType" => "DNI",
"identificationNumber" => "12345678",
"phoneNumber" => "+5491123456789",
)
)
);
$json_data = json_encode($data);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
Respuesta JSON
{
"status": 200,
"data": [{TICKETDATA}],
"errors": null
}
Para mas información detallada de Ticket y la información del comprador diríjase a la sección de datos de ticket